1. Field of the Invention
The invention relates to the field of use of compressing and decompressing of multi-colored images. In particular, the invention provides an enhanced version of run-length encoding (RLE).
2. Description of Related Art
In many low power, low cost embedded applications, there needs to be cost-effective ways to lower system power in systems which include a display. To lower system power consumption, the data in the display buffer of the system, which, for example, is contained in dynamic random access memory (DRAM), can be compressed, allowing the data to be stored on a small local buffer more often and thus making it possible for external memory to be powered down more often. System performance will also be increased by freeing up the external data bus for accesses by the processor or other peripherals as there is less data which has to be transferred over the data bus as the local buffer will often be able to store the data for an image.
Run-length encoding (RLE) is an efficient way to compress multicolored image buffers losslessly in hardware. The basic idea of RLE is to encode a "run" of pixels as a codeword with a run-length field and a pixel value (color) field. A run is defined as a stream of pixels of the same value within a row. A pixel whose pixel value (color) differs from its left and right neighbors is said to have a run length of 1. These type of pixels are known as singleton pixels.
There are many variants of this basic RLE scheme. For example, a code type field can be added and different encoding schemes can be tailored for runs of different characteristics to increase the compression ratio (e.g. short runs can be encoded in a shorter codeword than long runs; a series of runs of length 1 can be stored unencoded by preceding them with an escape code containing the number of the singleton pixels). But, for all these variants the basic idea is still to encode a run with a run-length/pixel value pair.